package com.hps.poet.service.impl;

import com.hps.common.utils.BeanHelper;
import com.hps.poet.PoemDTO;
import com.hps.poet.entity.Poem;
import com.hps.poet.mapper.PoemMapper;
import com.hps.poet.service.PoemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author HM
 * @since 2019-11-26
 */
@Service
public class PoemServiceImpl extends ServiceImpl<PoemMapper, Poem> implements PoemService {

    @Override
    public List<PoemDTO> poemDTOList() {
        List<Poem> poemList = this.list(null);
        return BeanHelper.copyWithCollection(poemList, PoemDTO.class);
    }
}
